﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using EventBroker;

namespace Algorithm
{
    /// <summary>
    /// Concrete class that implements the crawling algorithm for a website
    /// </summary>
    public class CJumperConcreteProduct_MayBank : CJumperAbstractProduct
    {
        [CEventPublication("Topic:MayBank_ProductA_ParseAsync")]
        public event EventHandler m_edMayBank_ProductA_ParseAsync;

        [CEventPublication("Topic:MayBank_ProductB_ParseAsync")]
        public event EventHandler m_edMayBank_ProductB_ParseAsync;

      
        /// <summary>
        /// Overriden method that implements the algorithm to crawl a website
        /// </summary>
        [CEventSubscription("Topic:StartJumpingGroup", Thread = EThreadOption.Background, WorkItemGroupName = "MayBank_ProductA_ParseAsync")]
        public void ProductA_JumpAsync(object objSender_p, EventArgs eventArgs_p)
        {            
            //To do your own jumping style here
            System.Diagnostics.Debug.WriteLine("In MayBank_ProductA_JumpAsync");

            this.m_edMayBank_ProductA_ParseAsync(this, EventArgs.Empty);            
        }

        /// <summary>
        /// Overriden method that implements the algorithm to crawl a website
        /// </summary>
        [CEventSubscription("Topic:StartJumpingGroup", Thread = EThreadOption.Background, WorkItemGroupName = "MayBank_ProductB_ParseAsync")]
        public void ProductB_JumpAsync(object objSender_p, EventArgs eventArgs_p)
        {
            //To do your own jumping style here
            System.Diagnostics.Debug.WriteLine("In MayBank_ProductB_JumpAsync");

            this.m_edMayBank_ProductB_ParseAsync(this, EventArgs.Empty);
        }
    }
}
